// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 新增单个数据,并返回新增后的数据. POST /picture */
export async function add2(body: API.PictureEntity, options?: { [key: string]: any }) {
  return request<API.PictureEntity>('/picture', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 保存数据 如果传入了id,并且对应数据存在,则尝试覆盖,不存在则新增. PATCH /picture */
export async function save1(body: API.PictureEntity[], options?: { [key: string]: any }) {
  return request<API.SaveResult>('/picture', {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量新增数据 POST /picture/_batch */
export async function add3(body: API.PictureEntity[], options?: { [key: string]: any }) {
  return request<number>('/picture/_batch', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 使用GET方式查询总数 GET /picture/_count */
export async function count3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.count3Params,
  options?: { [key: string]: any },
) {
  return request<number>('/picture/_count', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 使用POST方式查询总数 POST /picture/_count */
export async function count1(body: API.QueryParamEntity, options?: { [key: string]: any }) {
  return request<number>('/picture/_count', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 使用GET方式判断数据是否存在 GET /picture/_exists */
export async function exists3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.exists3Params,
  options?: { [key: string]: any },
) {
  return request<boolean>('/picture/_exists', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 使用POST方式判断数据是否存在 POST /picture/_exists */
export async function exists1(body: API.QueryParamEntity, options?: { [key: string]: any }) {
  return request<boolean>('/picture/_exists', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 使用GET方式分页动态查询 GET /picture/_query */
export async function queryPager3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryPager3Params,
  options?: { [key: string]: any },
) {
  return request<API.PagerResultPictureEntity>('/picture/_query', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 使用POST方式分页动态查询 POST /picture/_query */
export async function queryPager1(body: API.QueryParamEntity, options?: { [key: string]: any }) {
  return request<API.PagerResultPictureEntity>('/picture/_query', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 使用GET方式分页动态查询(不返回总数) 此操作不返回分页总数,如果需要获取全部数据,请设置参数paging=false GET /picture/_query/no-paging */
export async function query3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.query3Params,
  options?: { [key: string]: any },
) {
  return request<API.PictureEntity[]>('/picture/_query/no-paging', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 使用POST方式分页动态查询(不返回总数) 此操作不返回分页总数,如果需要获取全部数据,请设置参数paging=false POST /picture/_query/no-paging */
export async function query1(body: API.QueryParamEntity, options?: { [key: string]: any }) {
  return request<API.PictureEntity[]>('/picture/_query/no-paging', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据ID查询 GET /picture/${param0} */
export async function getById1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getById1Params,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.PictureEntity>(`/picture/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 根据ID修改数据 PUT /picture/${param0} */
export async function update1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.update1Params,
  body: API.PictureEntity,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<boolean>(`/picture/${param0}`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 根据ID删除 DELETE /picture/${param0} */
export async function delete1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.delete1Params,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.PictureEntity>(`/picture/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 审核图片 POST /picture/review */
export async function reviewingPicture(body: {}, options?: { [key: string]: any }) {
  return request<string>('/picture/review', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 上传图片 POST /picture/upload */
export async function uploadPicture(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.uploadPictureParams,
  body: {},
  options?: { [key: string]: any },
) {
  return request<API.PictureEntity>('/picture/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
      picture: undefined,
      ...params['picture'],
    },
    data: body,
    ...(options || {}),
  });
}
